<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../vue.js"></script>
    <script src="../axios.min.js"></script>
  </head>
  <body>
    <div id="app">
      <input type="text" v-model="val" />
      <ul>
        <li v-for="item in list">{{item[0]}}</li>
      </ul>
    </div>

    <script>
      var vm = new Vue({
        el: "#app",
        data: {
          val: "",
          list: [],
        },
        watch: {
          val: function (n, o) {
            // console.log(n);
            axios
              .get(
                "https://api.kele8.cn/agent/https://suggest.taobao.com/sug?code=utf-8&q=" +
                  n
              )
              .then((response) => {
                console.log(response.data, this);
                this.list = response.data.result;
              });
          },
        },
      });
    </script>

    <!-- https://www.baidu.com/sugrec?ie=utf-8&json=1&prod=pc&from=pc_web&wd=%E5%B0%8F%E7%B1%B3 -->
  </body>
</html>
